#include "stdio.h"
#include "stdlib.h"
#include "syscall.h"

int main()
{
	int fd, ret;
	int barrier = bcreate(100, 2);
	char buf[4];
	int i;
	//creat("z.test");
	//fd = open("z.test");
	//ret = write(fd, "zzz", 3);
	//if((ret = read(fd, buf, 3)) > 0)
	//{
	//	printf("Am citit %d octeti: %s\n", ret, buf);
	//}
	//close(fd);

	printf("Executam un alt program: halt.exe...\n");	
	char* argv[1] = {"../test/halt.exe"};	
	exec("../test/halt.exe", 1, argv);
	//printf("lskfjksd");

	for (i = 0; i < 10; i++)
		printf("BWAIT\n");
	bwait(100);
	
		printf("bwait create halt return val: %d \n", ret);

	//exit(0);
}
